import {defineStore} from 'pinia'
import {ref}from 'vue'
//定义仓库 存储单元
export const counterStore = defineStore('counter',()=>{
    //响应式数据
    const count =ref(0)//声明一个响应式数据
    const addCount = ()=>{
        count.value++
    }
    const cutCount=()=>{
        count.value--
    }
    return {count,addCount,cutCount}
}, {
    persist: true // 开启持久化存储
}
)